#!/bin/bash

# Start the hdwr_svr
#
ulimit -c 1000000

if [ -f /var/hsc/log/.DEBUG_HSC ]; then
   /opt/hsc/bin/hdwr_svr > /var/hsc/log/hdwr_svr.log 2>&1 &
   TOP_HDWR_SVR_ID=$!
else
   /opt/hsc/bin/hdwr_svr &
   TOP_HDWR_SVR_ID=$!
fi

# Record the thread ids for the started hdwr_svr
sleep 5
ps -efwww | grep hdwr_svr | awk {'print $2'} > /var/hsc/hdwr_svr_proc_ids

wait $TOP_HDWR_SVR_ID
echo "hdwr_svr stopped on "`date` > /tmp/hdwr_svrStopped.log
